package 其他流;

import java.io.*;

public class 转换流 {
    public static void main(String[] args) throws IOException {
//        nnn();


//        du();


        OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream("test-IO/a.txt"));
        out.write("荣磊");
        out.close();
    }

    private static void du() throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("test-IO/a.txt"));
        int ch;
        while ((ch = isr.read())!=-1){
            System.out.println((char) ch);
        }
        isr.close();
    }

    private static void nnn() throws IOException {
        FileReader fr = new FileReader("test-IO/a.txt");
        int ch;
        while ((ch=fr.read())!=-1){
            System.out.println((char) ch);
        }
        fr.close();
    }
}
